//final version of shuffle


unsigned char shuffle () //makes a shuffle
{ 

  for (h=1; h<53; h++)
     pac[h-1]=h;
	

  for (i=0; i<52; i++)
      {
       do
         {
           rn=RANDOM(0,51);
           sv=0; //i has to be counted
              
			   for(j=0;j<i;j++)
			      {
                   if(rn==pac[j])
                     {
                      sv=1;
                      break;
                      }
                  }
         }while (sv==1);

          pac[i]=rn;
          last_name[i]=numbers[rn];
          last_type[i]=symbs[rn];

         
       }
return 1;
}

void shuffling()  //display the shuffling screen and ask for a shuffle
{
CLEAR_LCD
LCD_XY(2,1)
LCD_TEXT("Shuffling...")
	 do{    
	 finished=shuffle();
	}while(finished!=1);
}
